<?php 
	$last_msg_id=@$_GET['last_msg_id'];
	$action=@$_GET['action'];

	if($action <> "get") {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link type='text/css' href='../Resource/css/homestyles.css' rel='stylesheet' />
<link rel="stylesheet" type="text/css" href="../Resource/css/sidebar.css" />
<link media="screen" rel="stylesheet" href="../Resource/css/colorbox.css" />


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type='text/javascript' src='../Resource/js/fixed.js'></script>
<script type='text/javascript' src='../Resource/js/dialog.js'></script>
<script type='text/javascript' src='../Resource/js/ui.core.js'></script>
<script type="text/javascript" src="../Resource/js/query-1.2.1.min.js"></script>

<script src="../Resource/js/sidebar.js" type="text/javascript"></script>

<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js"></script>

<script type="text/javascript" src="../Resource/js/jquery-1.2.6.pack.js"></script>


	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js"></script>
	<script src="../Resource/js/jquery.colorbox.js"></script>
	
	<script>
		$(document).ready(function(){
			
			$(".iframe").colorbox({iframe:true, width:"960px", height:"100%"});
			
			
			//Example of preserving a JavaScript event for inline calls.
			$("#click").click(function(){ 
				$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
				return false;
			});
		});
	</script>
	
	<script type="text/javascript">
	$(document).ready(function(){
		function last_msg_funtion() {
			 
			var ID=$(".app:last").attr("id");
			$('div#last_msg_loader').html('<img src="../Resource/images/loader.gif">');
			$.post("androidplatform.php?action=get&last_msg_id="+ID,
				
				function(data){
				if (data != "") {
					data = $(data);
					data.find(".iframe").colorbox({iframe:true, width:"960px", height:"100%"});
					$(".app:last").after(data); 					
				}
					$('div#last_msg_loader').empty();
				});
			}; 
			
				$(window).scroll(function(){
					if ($(window).scrollTop() == $(document).height() - $(window).height()){
					last_msg_funtion();
				}
		}); 
	});
</script>


	<!--[if lt IE 8]>
   	<style type="text/css">
   			li a {display:inline-block;}
   			li a {display:block;}
   		</style>
   	<![endif]-->
	
</head>

<body>


<div class="container">

	<?php include("sidebar.php");?>		
    <?php include("content.php");?>
 	<div id="last_msg_loader"></div>
 	  
</div>
<div style="display: none;" id="example" title="My First Ajax Dialog"></div>
</body>
</html>

<script type="text/javascript">
	$(document).ready(function(){
		function last_msg_funtion() {
			 
			var ID=$(".app:last").attr("id");
			$('div#last_msg_loader').html('<img src="../Resource/images/loader.gif">');
			$.post("androidplatform.php?action=get&last_msg_id="+ID,
				
				function(data){
				if (data != "") {
					$(".app:last").after(data); 
				}
					$('div#last_msg_loader').empty();
				});
			}; 
			
				$(window).scroll(function(){
					if ($(window).scrollTop() == $(document).height() - $(window).height()){
					last_msg_funtion();
				}
		}); 
	});
</script>

<?php 
	}else{
		include '../support/loadingscroll.php';
	}
?>
